<div class="modal-header">
    <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
    <h4 class="modal-title">包材单价</h4>
</div>
<form id="pack-price-form" action="/xqc/purchase/yj-order-ajax" method="post">
    <div class="modal-body">
        <div class="form-group">
            <label for="labels_name" style="padding-top: 8px;" class="col-sm-3 control-label">包材单价</label>
            <div class="col-sm-8">
                <input type="text" class="form-control" id="pack_price" name="param[pack_price]" placeholder="包材单价" required>
            </div>
        </div>
        <div class="form-group">
            <label style="padding-top: 8px;" class="col-sm-3 control-label">包材单价说明</label>
            <div class="col-sm-8">
                <input type="text" class="form-control" id="pack_price_desc" name="param[pack_price_desc]" placeholder="包材单价说明">
            </div>
        </div>
    </div>
    <div class="modal-footer">
        {{ csrf_field() }}
        <input type="hidden" name="param[id]" value="{{ $id }}">
        <input type="hidden" name="action" value="doPackPrice">
        <button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
        <button type="submit" class="btn btn-primary">提交</button>
    </div>
</form>
<script language="JavaScript" type="text/javascript">
    $(function () {
        $("#pack-price-form").ajaxForm(function (data) {
            if (typeof data === 'object') {
                if (data.status) {
                    $("#tempModal").modal('hide');
                    $(".modal-backdrop").remove();
                    $('body').removeClass('modal-open');
                    toastr.success(data.message);
                    $.pjax.reload("#order-edit-form");
                } else {
                    swal(data.message, '', 'error');
                }
            }
        });
    });
</script>
